﻿#include "mylisten.h"
#include <QDebug>

MyListen::MyListen(QObject *parent) : QObject(parent)
{
    timeout();

    timer = new QTimer(this);
    timer->setInterval(30);
    connect(timer, &QTimer::timeout, this, &MyListen::timeout);
    timer->start();
}

void MyListen::setmousePoint(QPoint p)
{
    if(p != m_mousePoint)
    {
        m_mousePoint = p;
        emit mousePointChanged();
    }
}

void MyListen::timeout()
{
    GetCursorPos(&p);
    setmousePoint(QPoint(p.x,p.y));
}
